package top.fkxuexi.blogapi.core.config.shiro;

import lombok.Getter;
import lombok.Setter;
import org.apache.shiro.authc.UsernamePasswordToken;

/**
 * 在shiro 验证realm的时候，辨别身份
 */
public class ShiroToken extends UsernamePasswordToken{

   public enum ShiroType{
        ADMIN("Admin"),
        REST("Rest");
        @Setter@Getter private String type;
        ShiroType(String type){
            this.type = type;
        }
    }



    @Setter@Getter private String userType;

    public ShiroToken (String userName,String pwd,ShiroType userType){
        super(userName,pwd);
        this.userType = userType.getType();
    }


}
